////////////////////////////////////////////////////////
//  constructor of XVideoPlayer
XVideoPlayer = function () {
    this.video = null;
    this.videoCenter = null;
    this.subTitleDecoder = null;
};
//  methods of XVideoPlayer
XVideoPlayer.prototype = {
    init: function (id, handler) {
        this.video = document.getElementById(id);
        this.video.addEventListener("timeupdate", handler);
    },
    timeUpdate: function () {
        this.videoCenter.onSubTitleChanged(this.video.currentTime);
    },
    registerVideoCenter: function (videoCenter) {
        this.videoCenter = videoCenter;
    },
    registerSubTitleDecoder: function (subTitleDecoder) {
        this.subTitleDecoder = subTitleDecoder;
    },
    play: function () {
        this.video.play();
    },
    seek: function (time) {
        this.video.currentTime = time;
    },
    setVolume: function (vol) {
        this.video.volume = vol / 100.0;
    },
    loadVideo: function (url) {
        this.video.src = url;
    },
    pause: function () {
        this.video.pause();
    }
};

////////////////////////////////////////////////////////
//  VideoJSPlayer
//VideoJSPlayer = function (id) {
//    this.video = null;//_V_(id);
//};

//VideoJSPlayer.prototype = {
//    init: function (id, handler) {
//        this.video = videojs(id);
//        this.video.on("timeupdate", handler);
//    },
//    timeUpdate: function () {
//        var subTitle;
//        this.videoCenter.onSubTitleChanged(this.video.currentTime());
//    },
//    registerVideoCenter: function (videoCenter) {
//        this.videoCenter = videoCenter;
//    },
//    registerSubTitleDecoder: function (subTitleDecoder) {
//        this.subTitleDecoder = subTitleDecoder;
//    },
//    play: function () {
//        this.video.play();
//    },
//    seek: function (time) {
//        this.video.currentTime(time);// = time;
//    },
//    setVolume: function (vol) {
//        this.video.volume(vol / 100.0);
//    }
//};